package com.panasonic.web.service.impl;

import com.panasonic.web.domain.cms.CmsExamScore;
import com.panasonic.web.mapper.CmsExamScoreMapper;
import com.panasonic.web.service.ICmsExamScoreService;
import com.panasonic.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 考试分数Service业务层处理
 * 
 * @author lwf
 * @date 2021-11-16
 */
@Service
public class CmsExamScoreServiceImpl implements ICmsExamScoreService 
{
    @Autowired
    private CmsExamScoreMapper cmsExamScoreMapper;

    /**
     * 查询考试分数
     * 
     * @param id 考试分数ID
     * @return 考试分数
     */
    @Override
    public CmsExamScore selectCmsExamScoreById(Long id)
    {
        return cmsExamScoreMapper.selectCmsExamScoreById(id);
    }

    /**
     * 查询考试分数列表
     * 
     * @param cmsExamScore 考试分数
     * @return 考试分数
     */
    @Override
    public List<CmsExamScore> selectCmsExamScoreList(CmsExamScore cmsExamScore)
    {
        return cmsExamScoreMapper.selectCmsExamScoreList(cmsExamScore);
    }

    /**
     * 新增考试分数
     * 
     * @param cmsExamScore 考试分数
     * @return 结果
     */
    @Override
    public int insertCmsExamScore(CmsExamScore cmsExamScore)
    {
        cmsExamScore.setCreateTime(DateUtils.getNowDate());
        return cmsExamScoreMapper.insertCmsExamScore(cmsExamScore);
    }

    /**
     * 修改考试分数
     * 
     * @param cmsExamScore 考试分数
     * @return 结果
     */
    @Override
    public int updateCmsExamScore(CmsExamScore cmsExamScore)
    {
        cmsExamScore.setUpdateTime(DateUtils.getNowDate());
        return cmsExamScoreMapper.updateCmsExamScore(cmsExamScore);
    }

    /**
     * 批量删除考试分数
     * 
     * @param ids 需要删除的考试分数ID
     * @return 结果
     */
    @Override
    public int deleteCmsExamScoreByIds(Long[] ids)
    {
        return cmsExamScoreMapper.deleteCmsExamScoreByIds(ids);
    }

    /**
     * 删除考试分数信息
     * 
     * @param id 考试分数ID
     * @return 结果
     */
    @Override
    public int deleteCmsExamScoreById(Long id)
    {
        return cmsExamScoreMapper.deleteCmsExamScoreById(id);
    }
}
